#coding=utf8
#LightCam 处理snmpinterface.txt程序
#init by hfh 20150608

import time,re,sys,traceback,threading,subprocess,pymongo,json
import lc_libs

if __name__ == "__main__":


	cmd='vmstat -n 1 > /dev/null 2>&1 &'
	popen=subprocess.Popen(cmd,stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE,shell=True)
	flag=0
	while True:
		if flag == 2:
			break
		if popen.poll()==None:
			time.sleep(0.1)
			flag+=1
			continue
		else:
			break
	print popen.stdout.read()
